package com.ruizhong.centercontroll.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruizhong.centercontroll.entity.TButton;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TButtonMapper extends BaseMapper<TButton> {
    @Select("select page_id from t_button where id = #{mainId}")
    Integer getPageIdByButtonId(@Param("mainId") Integer mainId);

    @Select("select * from t_button where page_id = #{pageId} and added_button_group_arr_data like '%' || #{triggerGroup} || '%'")
    List<TButton> getButtonsByPageIdAndGroupName(@Param("pageId") Integer pageId,@Param("triggerGroup") String triggerGroup);
}
